package ssn.inven.service.impl;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import ssn.common.code.service.CodeService;
import ssn.common.vo.SearchVO;
import ssn.inven.service.InvenService;
import ssn.servicearea.service.ServiceAreaService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
import egovframework.rte.fdl.property.EgovPropertyService;

/**  
 * @Class Name : 
 * @Description : 
 * 
 * @author ksh
 * @since 2013. 09.26
 * @version 1.0
 * @see
 */
@SuppressWarnings({"rawtypes","unchecked"})
@Service("invenService")
public class InvenServiceImpl extends AbstractServiceImpl implements InvenService {
	@Resource(name="invenDAO")
	private InvenDAO invenDAO; 
	
	@Resource(name = "codeService")
    private CodeService codeService;
	
	@Resource(name = "propertiesService")
    protected EgovPropertyService propertiesService;
	
	@Resource(name = "serviceareaService")
    private ServiceAreaService serviceareaService;

	public Map selectInvenOtherInfo() throws Exception{
		Map resultMap = new HashMap();
		resultMap.put("serviceareaList", serviceareaService.selectServiceAreaList());
		return resultMap;
	}
	public Map selectDailyUseDrug(SearchVO vo) throws Exception {
		Map resultMap = new HashMap();
		resultMap.put("invenCodeList", codeService.selectCodeInfoList(propertiesService.getString("scc.codekey.inven")));
		resultMap.put("searchVO", vo);
		resultMap.put("resultList", invenDAO.selectDailyUseDrug(resultMap));
		resultMap.put("resultSumList", invenDAO.selectDailyUseDrugSum(resultMap));
		return resultMap;
	}
}
